<template>
    <view class="rank-list">
        <view class="title">
            <span class="select">بۈگۈن يوقلىمىدىن ئۆتكەنلەر</span>
        </view>
        <div class="content">
            <li :class="['item', `a${index+1}`]" v-for="(item, index) in list" :key="index">
                <view class="san">{{index+1}}</view>
                <div class="avatar">
                    <image class="imng" :src="item.useravatar"></image>
                </div>
                <view class="username">{{item.username}}</view>
                <view class="time">{{item.signs_time}}</view>
                <view class="coin">{{item.usercion}} تەڭگە</view>
            </li>
        </div>
    </view>
</template>

<script>
    export default {
        props: {
            list: {
                type: Array,
                default: () => []
            },
        },
    }
</script>

<style lang="scss" scoped>
    .rank-list {
        overflow: hidden;
        margin-top: 30rpx;
        background-color: #fff;

        .title {
            height: 100rpx;
            line-height: 100rpx;
            text-align: center;
            direction: rtl;
            border-bottom: 1rpx solid #eee;

            .select {
                overflow: hidden;
                height: 60rpx;
                line-height: 56rpx;
                display: inline-block;
                background-color: #f5f5f5;
                padding: 0 20rpx;
                margin: 20rpx 10rpx 0;
                border-radius: 8rpx;
                color: #77788a;
                background-color: rgba(100, 193, 255, 0.1);
                color: #117af1;
            }

        }

        .content {
            padding: 30rpx;
            overflow: hidden;
            display: block;

            .item {
                overflow: hidden;
                display: block;
                margin-bottom: 20rpx;

                &.a1 {
                    .username {
                        color: #116bf1;
                    }

                    .san {
                        color: #fff;
                        background-image: linear-gradient(90deg, #0aece7 0%, #5885fb 100%);
                    }


                }

                &.a2 {
                    .username {
                        color: #f12711;
                    }

                    .san {
                        color: #fff;
                        background-image: linear-gradient(45deg, #f12711 0%, #f5af19 100%);
                    }
                }

                &.a3 {
                    .username {
                        color: #f12711;
                    }

                    .san {
                        color: #fff;
                        background-image: linear-gradient(45deg, #f12711 0%, #f5af19 100%);
                    }
                }

                .username {
                    overflow: hidden;
                    font-size: 24rpx;
                    color: #58596d;
                    float: right;
                    margin-right: 20rpx;
                    height: 50rpx;
                    line-height: 50rpx;
                    width: 200rpx;
                    text-align: right;
                    text-overflow: ellipsis;
                    white-space: nowrap;
                }

                .avatar {
                    width: 50rpx;
                    height: 50rpx;
                    float: right;
                    border-radius: 50%;
                    overflow: hidden;

                    .img {
                        width: 100%;
                        height: 100%;
                        display: block;
                    }
                }

                .san {
                    width: 30rpx;
                    float: right;
                    height: 30rpx;
                    line-height: 30rpx;
                    text-align: center;
                    color: #58596d;
                    background-color: #d7d9e8;
                    margin-left: 10rpx;
                    border-radius: 50%;
                    font-size: 20rpx;
                    margin-top: 10rpx;


                }

                .coin {
                    color: #f12711;
                    direction: rtl;
                    margin-left: 50rpx;
                    float: left;
                    font-size: 22rpx;
                    height: 50rpx;
                    line-height: 50rpx;
                }

                .time {
                    float: left;
                    font-size: 22rpx;
                    height: 50rpx;
                    line-height: 50rpx;
                    color: #999;
                }
            }

        }
    }
</style>